home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PPC1B3AA.ZIP / PRFADE.PPS < prev    next >
Text File  |  1996-08-29  |  2KB  |  74 lines

  1. ;----------------------------------------------------------------------------
  2. ; Copyright(C) 1996, The AEGiS Corporation
  3. ;----------------------------------------------------------------------------
  4. ;
  5. ; PROCEDURE PrintFade()
  6. ;
  7. ; This procedure writes a text in color 15 with a fading effect on every
  8. ; character
  9. ;----------------------------------------------------------------------------
  10. #lib
  11. #nouser
  12.  
  13. Declare Procedure PrintFade(String Str)
  14. Declare Procedure PF_RemCursor()
  15. Declare Procedure PF_Synchronize()
  16. Boolean PF_NoRemCursor
  17. Boolean PF_NoSynchro
  18.  
  19. ;----------------------------------------------------------------------------
  20. Procedure PrintFade(String Str)
  21. Integer v_int1, v_int2, v_int3
  22.  
  23. For v_int1 = 1 to len(Str)                 ; for each character
  24.     If (Mid(Str, v_int1, 1) = " ") Then    ; if this is a space, no fade
  25.         Print "@X0F "
  26.         Continue
  27.     Endif
  28.     Print "@X08" + Mid(Str, v_int1, 1)     ; print in color 8
  29.     v_int2 = getX()                          ; backup position
  30.     v_int3 = getY()
  31.     PF_RemCursor()                             ; remove cursor
  32.     Delay 1                                  ; wait one tick
  33.     AnsiPos v_int2, v_int3                   ; restore position
  34.     Backup 1                                 ; move cursor back 1 char
  35.     Print "@X07" + Mid(Str, v_int1, 1)     ; print in color 7
  36.     v_int2 = getX()
  37.     v_int3 = getY()
  38.     PF_RemCursor()
  39.     Delay 1
  40.     AnsiPos v_int2, v_int3
  41.     Backup 1
  42.     Print "@X0F" + Mid(Str, v_int1, 1)     ; print in color 15
  43.     v_int2 = getX()
  44.     v_int3 = getY()
  45.     PF_RemCursor()
  46.     Delay 1
  47.     PF_Synchronize()                            ; wait for other end
  48.     AnsiPos v_int2, v_int3
  49. Next
  50.  
  51. Color @X0F
  52.  
  53. Endproc
  54.  
  55. Procedure PF_RemCursor()
  56.  
  57. If (!PF_NoRemCursor) Then
  58.     AnsiPos 1,23
  59.     Color 0
  60.     Print " "
  61.     Backup 1
  62. Endif
  63.  
  64. EndProc
  65.  
  66. Procedure PF_Synchronize()
  67.  
  68. If (!PF_NoSynchro) Then
  69.     While (Outbytes() > 0) Do
  70.     EndWhile
  71. Endif
  72.  
  73. EndProc
  74.